//
// Created by Administrator on 2025/7/8.
//

#ifndef _STM32FLASH_H
#define _STM32FLASH_H

#include "stdint.h"

#ifdef __cplusplus
extern "C" {
#endif

int flash_erase(uint32_t addr, uint32_t size);
uint32_t flash_read(uint32_t addr, uint32_t *data, uint32_t size);
uint32_t flash_write(uint32_t addr, const uint32_t *data, uint32_t size);
uint32_t flash_write_safe(uint32_t addr, uint32_t *data, uint32_t size);

#ifdef __cplusplus
}
#endif

#endif //_STM32FLASH_H
